package com.zfj.gulimall.product.config;

import com.baomidou.mybatisplus.annotation.DbType;
import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.EnableTransactionManagement;

/**
 * @author zfj
 * @date 2022/5/29 -14:18
 */
@Configuration
@EnableTransactionManagement//开启事务
@MapperScan("com.zfj.gulimall.product.dao")
public class MyBatisConfig {
	@Bean
	public PaginationInterceptor paginationInterceptor() {
		PaginationInterceptor interceptor = new PaginationInterceptor();
		//设置分页请求
		interceptor.setOverflow(true);
		//设置最大单页限制数量
		interceptor.setLimit(1000);
		return interceptor;
	}
}
